package morning.cat;

import feign.Feign;
import feign.gson.GsonEncoder;
import morning.cat.client.PersonClient;
import morning.cat.entity.Person;
import morning.cat.service.UrlService;

/**
 * @describe: 类描述信息
 * @author: morningcat.zhang
 * @date: 2019/6/4 2:00 PM
 */
public class PersonTest2 {

    public static void main(String[] args) {

        // 获取服务接口
        PersonClient personClient = Feign.builder()
                .encoder(new GsonEncoder())
                .target(PersonClient.class, UrlService.SERVER_URL);
        // 创建参数的实例
        Person person = Person.builder().id(9).name("仙女").age(20).message("小仙女").build();
        String response = personClient.createPerson(person);
        System.out.println(response);
    }
}
